#include <algorithm>
#include <cstdio>
using namespace std;

const int N = 100010;
int n, x;
int a[N], pre[N], suf[N];

int main() {
#ifndef ONLINE_JUDGE
#ifdef DEBUG
	freopen("testdata.in", "r", stdin);
	freopen("testdata.out", "w", stdout);
#endif
#ifndef DEBUG
	freopen("poker.in", "r", stdin);
	freopen("poker.out", "w", stdout);
#endif
#endif

	scanf("%d%d", &n, &x);
	for (int i = 1; i <= n; ++i) {
		scanf("%d", &a[i]);
		pre[i] = pre[i - 1] | a[i];
	}
	for (int i = n; i; --i) {
		suf[i] = suf[i + 1] | a[i];
	}
	long long ans = 0;
	for (int i = 1; i <= n; ++i) {
		ans = max(ans, ((long long)a[i] * x) | (long long)suf[i + 1] | (long long)pre[i - 1]);
	}
	printf("%lld", ans);
	return 0;
}